Skip to content

test: compare the symlinked-root scan path by filesystem identity (Windows) - #725

Merged
ffumero2003 merged 1 commit into
masterfrom
fix-python-windows-symlink-samefile
Nov 22, 2026
Merged

ffumero2003 merged 1 commit into
masterfrom
fix-python-windows-symlink-samefile

Conversation

@ffumero2003

Copy link
Copy Markdown
Contributor

Context

The Windows test matrix is still red on test_make_full_path_accepts_internal_link_and_symlinked_root after #724:

AssertionError: assert '\\?\\C:\\...\\new-file.txt' == 'C:\\Users\\...\\new-file.txt'

Root cause

#724 compared os.path.realpath() of both sides, but realpath keeps the extended-length (\\?\\) prefix already present on the returned path while not adding it to the expected path, so they still differ. The prefix is a Windows representation artifact, not a behavioural difference.

Changes

  • Compare by filesystem identity: assert the basename is new-file.txt and os.path.samefile() on the (existing) parent directory of both paths. This is immune to the \\?\\ prefix, 8.3 names, and drive casing. Linux/macOS unaffected.

Verification

  • The parent directory exists (internal symlink), so samefile resolves both to the same inode; the behavioural check (symlinked root + internal link accepted, pointing at the right file) is preserved.

Refs #711

The previous realpath comparison (#724) did not normalize the Windows
extended-length (\\?\\) prefix: realpath keeps it on the returned path
but not on the expected one. Compare os.path.samefile of the existing
parent directory plus the file name, which is immune to the prefix.

Refs #711
@ffumero2003 ffumero2003 self-assigned this Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f5729bea-f918-4c7e-9241-baed8768b8c8
Commits

Reviewing files that changed from the base of the PR and between 901933f and 0c9bbfb.

Files selected for processing: 2

  • changelog.d/+windows-symlink-samefile.infrastructure.md
  • test/unit/scan/test_folder.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@ffumero2003
ffumero2003 merged commit 7fc2437 into master Nov 22, 2026
29 checks passed
@ffumero2003
ffumero2003 deleted the fix-python-windows-symlink-samefile branch November 22, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant